<!DOCTYPE HTML>
<html lang="zh-tw" >
    <!-- Start book python基础语言 -->
    <head>
        <!-- head:start -->
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>垃圾回收(一) | python基础语言</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-splitter/splitter.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-emphasize/plugin.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../03day/section.0.1.1.html" />
    
    
    <link rel="prev" href="../03day/index.html" />
    

        <!-- head:end -->
    </head>
    <body>
        <!-- body:start -->
        
    <div class="book"
        data-level="3.1"
        data-chapter-title="垃圾回收(一)"
        data-filepath="03day/section.0.1.md"
        data-basepath=".."
        data-revision="Fri Mar 17 2017 08:48:09 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        课程介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="01day/index.html">
            
                
                    <a href="../01day/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        面向对象进阶
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="01day/section.1.0.html">
            
                
                    <a href="../01day/section.1.0.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        元类
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="01day/section.1.1.html">
            
                
                    <a href="../01day/section.1.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        python是动态语言
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="01day/section.1.3.html">
            
                
                    <a href="../01day/section.1.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        __slots__
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="02day/section.4.html">
            
                
                    <a href="../02day/section.4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        生成器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="02day/section.3.html">
            
                
                    <a href="../02day/section.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        迭代器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="02day/section.1.html">
            
                
                    <a href="../02day/section.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        闭包
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="02day/section.2.html">
            
                
                    <a href="../02day/section.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        装饰器
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="02day/index.html">
            
                
                    <a href="../02day/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        其他的知识点
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="03day/section.0.2.html">
            
                
                    <a href="../03day/section.0.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        import导入模块
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="03day/section.1.1.html">
            
                
                    <a href="../03day/section.1.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        循环导入
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="03day/section.0.3.html">
            
                
                    <a href="../03day/section.0.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        作用域
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="03day/section.2.html">
            
                
                    <a href="../03day/section.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        ==、is
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="03day/section.1.html">
            
                
                    <a href="../03day/section.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        深拷贝、浅拷贝
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="03day/section.6.html">
            
                
                    <a href="../03day/section.6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        进制、位运算
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="01day/section.3.html">
            
                
                    <a href="../01day/section.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        私有化
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="01day/section.3.1.html">
            
                
                    <a href="../01day/section.3.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        属性property
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="03day/index.html">
            
                
                    <a href="../03day/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        其他的知识点
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="3.1" data-path="03day/section.0.1.html">
            
                
                    <a href="../03day/section.0.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        垃圾回收(一)
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="03day/section.0.1.1.html">
            
                
                    <a href="../03day/section.0.1.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        垃圾回收(二)
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="03day/section.0.1.2.html">
            
                
                    <a href="../03day/section.0.1.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        垃圾回收(三)-gc模块
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="01day/section.4.html">
            
                
                    <a href="../01day/section.4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        内建属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="01day/section.6.html">
            
                
                    <a href="../01day/section.6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        内建函数
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="01day/section.7.html">
            
                
                    <a href="../01day/section.7.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        集合set
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="02day/section.5.html">
            
                
                    <a href="../02day/section.5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        functools
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="03day/section.4.html">
            
                
                    <a href="../03day/section.4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        模块
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="03day/section.3.html">
            
                
                    <a href="../03day/section.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.9.</b>
                        
                        调试
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="03day/section.5.html">
            
                
                    <a href="../03day/section.5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.</b>
                        
                        编码风格
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    本書使用 GitBook 釋出
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >python基础语言</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x5783;&#x573E;&#x56DE;&#x6536;">&#x5783;&#x573E;&#x56DE;&#x6536;</h1>
<h3 id="1-&#x5C0F;&#x6574;&#x6570;&#x5BF9;&#x8C61;&#x6C60;">1. &#x5C0F;&#x6574;&#x6570;&#x5BF9;&#x8C61;&#x6C60;</h3>
<p>&#x6574;&#x6570;&#x5728;&#x7A0B;&#x5E8F;&#x4E2D;&#x7684;&#x4F7F;&#x7528;&#x975E;&#x5E38;&#x5E7F;&#x6CDB;&#xFF0C;Python&#x4E3A;&#x4E86;&#x4F18;&#x5316;&#x901F;&#x5EA6;&#xFF0C;&#x4F7F;&#x7528;&#x4E86;&#x5C0F;&#x6574;&#x6570;&#x5BF9;&#x8C61;&#x6C60;&#xFF0C;
&#x907F;&#x514D;&#x4E3A;&#x6574;&#x6570;&#x9891;&#x7E41;&#x7533;&#x8BF7;&#x548C;&#x9500;&#x6BC1;&#x5185;&#x5B58;&#x7A7A;&#x95F4;&#x3002;</p>
<p>Python &#x5BF9;&#x5C0F;&#x6574;&#x6570;&#x7684;&#x5B9A;&#x4E49;&#x662F; [-5, 257)
&#x8FD9;&#x4E9B;&#x6574;&#x6570;&#x5BF9;&#x8C61;&#x662F;&#x63D0;&#x524D;&#x5EFA;&#x7ACB;&#x597D;&#x7684;&#xFF0C;&#x4E0D;&#x4F1A;&#x88AB;&#x5783;&#x573E;&#x56DE;&#x6536;&#x3002;&#x5728;&#x4E00;&#x4E2A; Python 
&#x7684;&#x7A0B;&#x5E8F;&#x4E2D;&#xFF0C;&#x6240;&#x6709;&#x4F4D;&#x4E8E;&#x8FD9;&#x4E2A;&#x8303;&#x56F4;&#x5185;&#x7684;&#x6574;&#x6570;&#x4F7F;&#x7528;&#x7684;&#x90FD;&#x662F;&#x540C;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;.</p>
<p>&#x540C;&#x7406;&#xFF0C;&#x5355;&#x4E2A;&#x5B57;&#x6BCD;&#x4E5F;&#x662F;&#x8FD9;&#x6837;&#x7684;&#x3002;</p>
<p>&#x4F46;&#x662F;&#x5F53;&#x5B9A;&#x4E49;2&#x4E2A;&#x76F8;&#x540C;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x65F6;&#xFF0C;&#x5F15;&#x7528;&#x8BA1;&#x6570;&#x4E3A;0&#xFF0C;&#x89E6;&#x53D1;&#x5783;&#x573E;&#x56DE;&#x6536;</p>
<h3 id="2-&#x5927;&#x6574;&#x6570;&#x5BF9;&#x8C61;&#x6C60;">2. &#x5927;&#x6574;&#x6570;&#x5BF9;&#x8C61;&#x6C60;</h3>
<p>&#x6BCF;&#x4E00;&#x4E2A;&#x5927;&#x6574;&#x6570;&#xFF0C;&#x5747;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x5BF9;&#x8C61;&#x3002;</p>
<p><img src="../Images/id2.png" alt="&#x5927;&#x6574;&#x6570;"></p>
<h3 id="3-intern&#x673A;&#x5236;">3. intern&#x673A;&#x5236;</h3>
<pre><code class="lang-python">a1 = <span class="hljs-string">&quot;HelloWorld&quot;</span>
a2 = <span class="hljs-string">&quot;HelloWorld&quot;</span>
a3 = <span class="hljs-string">&quot;HelloWorld&quot;</span>
a4 = <span class="hljs-string">&quot;HelloWorld&quot;</span>
a5 = <span class="hljs-string">&quot;HelloWorld&quot;</span>
a6 = <span class="hljs-string">&quot;HelloWorld&quot;</span>
a7 = <span class="hljs-string">&quot;HelloWorld&quot;</span>
a8 = <span class="hljs-string">&quot;HelloWorld&quot;</span>
a9 = <span class="hljs-string">&quot;HelloWorld&quot;</span>
</code></pre>
<p>python&#x4F1A;&#x4E0D;&#x4F1A;&#x521B;&#x5EFA;9&#x4E2A;&#x5BF9;&#x8C61;&#x5462;&#xFF1F;&#x5728;&#x5185;&#x5B58;&#x4E2D;&#x4F1A;&#x4E0D;&#x4F1A;&#x5F00;&#x8F9F;9&#x4E2A;&#x201D;HelloWorld&#x201D;&#x7684;&#x5185;&#x5B58;&#x7A7A;&#x95F4;&#x5462;&#xFF1F;
&#x60F3;&#x4E00;&#x4E0B;&#xFF0C;&#x5982;&#x679C;&#x662F;&#x8FD9;&#x6837;&#x7684;&#x8BDD;&#xFF0C;&#x6211;&#x4EEC;&#x5199;10000&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x6BD4;&#x5982;a1=&#x201D;HelloWorld&#x201D;&#x2026;..a1000=&#x201D;HelloWorld&#x201D;&#xFF0C;
&#x90A3;&#x4ED6;&#x5C82;&#x4E0D;&#x662F;&#x5F00;&#x8F9F;&#x4E86;1000&#x4E2A;&#x201D;HelloWorld&#x201D;&#x6240;&#x5360;&#x7684;&#x5185;&#x5B58;&#x7A7A;&#x95F4;&#x4E86;&#x5462;&#xFF1F;&#x5982;&#x679C;&#x771F;&#x8FD9;&#x6837;&#xFF0C;&#x5185;&#x5B58;&#x4E0D;&#x5C31;&#x7206;&#x4E86;&#x5417;&#xFF1F;&#x6240;&#x4EE5;python&#x4E2D;&#x6709;&#x8FD9;&#x6837;&#x4E00;&#x4E2A;&#x673A;&#x5236;&#x2014;&#x2014;<code>intern&#x673A;&#x5236;</code>&#xFF0C;&#x8BA9;&#x4ED6;&#x53EA;&#x5360;&#x7528;&#x4E00;&#x4E2A;&#x201D;HelloWorld&#x201D;&#x6240;&#x5360;&#x7684;&#x5185;&#x5B58;&#x7A7A;&#x95F4;&#x3002;&#x9760;&#x5F15;&#x7528;&#x8BA1;&#x6570;&#x53BB;&#x7EF4;&#x62A4;&#x4F55;&#x65F6;&#x91CA;&#x653E;&#x3002;</p>
<p><img src="../Images/id.png" alt="&#x5783;&#x573E;&#x56DE;&#x6536;"></p>
<h3 id="&#x603B;&#x7ED3;">&#x603B;&#x7ED3;</h3>
<ul>
<li>&#x5C0F;&#x6574;&#x6570;[-5,257)&#x5171;&#x7528;&#x5BF9;&#x8C61;&#xFF0C;&#x5E38;&#x9A7B;&#x5185;&#x5B58;</li>
<li>&#x5355;&#x4E2A;&#x5B57;&#x7B26;&#x5171;&#x7528;&#x5BF9;&#x8C61;&#xFF0C;&#x5E38;&#x9A7B;&#x5185;&#x5B58;</li>
<li>&#x5355;&#x4E2A;&#x5355;&#x8BCD;&#xFF0C;&#x4E0D;&#x53EF;&#x4FEE;&#x6539;&#xFF0C;&#x9ED8;&#x8BA4;&#x5F00;&#x542F;intern&#x673A;&#x5236;&#xFF0C;&#x5171;&#x7528;&#x5BF9;&#x8C61;&#xFF0C;&#x5F15;&#x7528;&#x8BA1;&#x6570;&#x4E3A;0&#xFF0C;&#x5219;&#x9500;&#x6BC1;
<img src="../Images/id5.png" alt="&#x5355;&#x8BCD;&#x5783;&#x573E;&#x56DE;&#x6536;"></li>
<li>&#x5B57;&#x7B26;&#x4E32;&#xFF08;&#x542B;&#x6709;&#x7A7A;&#x683C;&#xFF09;&#xFF0C;&#x4E0D;&#x53EF;&#x4FEE;&#x6539;&#xFF0C;&#x6CA1;&#x5F00;&#x542F;intern&#x673A;&#x5236;&#xFF0C;&#x4E0D;&#x5171;&#x7528;&#x5BF9;&#x8C61;&#xFF0C;&#x5F15;&#x7528;&#x8BA1;&#x6570;&#x4E3A;0&#xFF0C;&#x9500;&#x6BC1;
<img src="../Images/Snip20161106_6.png" alt=""></li>
<li>&#x5927;&#x6574;&#x6570;&#x4E0D;&#x5171;&#x7528;&#x5185;&#x5B58;&#xFF0C;&#x5F15;&#x7528;&#x8BA1;&#x6570;&#x4E3A;0&#xFF0C;&#x9500;&#x6BC1;
<img src="../Images/id2.png" alt="&#x5927;&#x6574;&#x6570;&#x5783;&#x573E;&#x56DE;&#x6536;"></li>
<li>&#x6570;&#x503C;&#x7C7B;&#x578B;&#x548C;&#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x578B;&#x5728; Python &#x4E2D;&#x90FD;&#x662F;&#x4E0D;&#x53EF;&#x53D8;&#x7684;&#xFF0C;&#x8FD9;&#x610F;&#x5473;&#x7740;&#x4F60;&#x65E0;&#x6CD5;&#x4FEE;&#x6539;&#x8FD9;&#x4E2A;&#x5BF9;&#x8C61;&#x7684;&#x503C;&#xFF0C;&#x6BCF;&#x6B21;&#x5BF9;&#x53D8;&#x91CF;&#x7684;&#x4FEE;&#x6539;&#xFF0C;&#x5B9E;&#x9645;&#x4E0A;&#x662F;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x5BF9;&#x8C61;
<img src="../Images/id6.png" alt="&#x4E0D;&#x53EF;&#x53D8;"></li>
</ul>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../03day/index.html" class="navigation navigation-prev " aria-label="Previous page: 其他的知识点"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../03day/section.0.1.1.html" class="navigation navigation-next " aria-label="Next page: 垃圾回收(二)"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-splitter/splitter.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"toggle-chapters":{},"splitter":{},"emphasize":{},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        <!-- body:end -->
    </body>
    <!-- End of book python基础语言 -->
</html>
